from django.db import models

# Create your models here.


class Users(models.Model):
	id = models.AutoField(primary_key=True)
	name = models.CharField(unique=True,max_length=10,db_index=True)
	passwd = models.CharField(max_length=18,db_index=True)
	email = models.EmailField()
	department = models.ForeignKey(to="Department",to_field='id')

	def __str__(self):
		return self.name


class Department(models.Model):
	id = models.AutoField(primary_key=True)
	dept = models.CharField(max_length=10)
	def __str__(self):
		return self.dept